To train a classification model, you need a dataset that includes historical features (characteristics of the entity for which you want to make a prediction) and known label values (the class indicator that you want to train a model to predict).

Create a dataset

In Microsoft Azure Machine Learning, data for model training and other operations is usually encapsulated in an object called a dataset .

1. In Azure Machine Learning studio , view the Datasets page. Datasets represent specific data files or tables that you plan to work with in Azure ML.

2. Create a dataset from web files, using the following settings:

Basic Info :

Settings and preview :

Schema :

Confirm details :

3. After the dataset has been created, open it and view the Explore page to see a sample of the data. This data represents details from patients who have been tested for diabetes.

Create a pipeline

To get started with Azure Machine Learning designer, first you must create a pipeline and add the dataset you want to work with.

1. In Azure Machine Learning studio for your workspace, view the Designer page and select + to create a new pipeline.

2. In the Settings pane, change the default pipeline name ( Pipeline-Created-on- date ) to Diabetes Training (if the Settings pane is not visible, click the ⚙ icon next to the pipeline name at the top).

3. Note that you need to specify a compute target on which to run the pipeline. In the Settings pane, click Select compute target and select the aml-cluster compute cluster you created previously.

4. On the left side of the designer, expand the Datasets section, and drag the diabetes-data dataset you created in the previous exercise onto the canvas.

5. Right-click (Ctrl+click on a Mac) the diabetes-data dataset on the canvas, and on the Visualize menu, select Dataset output .

6. Review the schema of the data, noting that you can see the distributions of the various columns as histograms.

7. Scroll to the right and select the column heading for the Diabetic column, and note that it contains two values 0 and 1 . These values represent the two possible classes for the label that your model will predict, with a value of 0 meaning that the patient does not have diabetes, and a value of 1 meaning that the patient is diabetic.

8. Scroll back to the left and review the other columns, which represent the features that will be used to predict the label. Note that most of these columns are numeric, but each feature is on its own scale. For example, Age values range from 21 to 77, while DiabetesPedigree values range from 0.078 to 2.3016. When training a machine learning model, it is sometimes possible for larger values to dominate the resulting predictive function, reducing the influence of features that on a smaller scale. Typically, data scientists mitigate this possible bias by normalizing the numeric columns so they're on the similar scales.

9. Close the diabetes-data result visualization window so that you can see the dataset on the canvas like this:

Add Transformations

Before you can train a model, you typically need to apply some preprocessing transformations to the data.

1. In the pane on the left, expand the Data Transformation section, which contains a wide range of modules you can use to transform data before model training.

2. Drag a Normalize Data module to the canvas, below the diabetes-data dataset. Then connect the output from the bottom of the diabetes-data dataset to the input at the top of the Normalize Data module, like this:

3. Select the Normalize Data module and view its settings, noting that it requires you to specify the transformation method and the columns to be transformed.

4. Set the transformation to MinMax and edit the columns to include the following columns by name, as shown in the image:

The data transformation is normalizing the numeric columns to put them on the same scale, which should help prevent columns with large values from dominating model training. You'd usually apply a whole bunch of pre-processing transformations like this to prepare your data for training, but we'll keep things simple in this exercise.

Run the pipeline

To apply your data transformations, you need to run the pipeline as an experiment.

1. Ensure your pipeline looks similar to this:

2. Select Submit , and run the pipeline as a new experiment named mslearn-diabetes-training on your compute cluster.

3. Wait for the run to finish - this may take a few minutes.

View the transformed data

The dataset is now prepared for model training.

1. Select the completed Normalize Data module, and in its Settings pane on the right, on the Outputs + logs tab, select the Visualize icon for the Transformed dataset .

2. View the data, noting that the numeric columns you selected have been normalized to a common scale.

3. Close the normalized data result visualization.